@extends('Index/vip/vip_base')
@section('con-right')
	<div class="pull-right">
		@if(!isset($_GET['step']))
		<div class="user-content__box clearfix bgf">
			<div class="title">账户信息-修改登陆密码</div>
			<div class="modify_div">
				<div class="clearfix">
					<a href="/index/vip/udai_pwd_modify?step=1" id="modifypwd" role="button" class="but">修改登陆密码</a>
					<a href="/index/vip/login?p=resetpwd" role="button" class="but">忘记登陆密码</a>
				</div>
				<div class="help-block">随时都能更改密码，保障您账户的安全</div>
			</div>
		</div>
		@elseif($_GET['step']==1)
		<div class="user-content__box clearfix bgf">
			<div class="title">账户信息-修改登陆密码</div>
			<div class="step-flow-box">
				<div class="step-flow__bd">
					<div class="step-flow__li step-flow__li_done">
					  <div class="step-flow__state"><i class="iconfont icon-ok"></i></div>
					  <p class="step-flow__title-top">输入旧密码</p>
					</div>
					<div class="step-flow__line step-flow__line_ing">
					  <div class="step-flow__process"></div>
					</div>
					<div class="step-flow__li">
					  <div class="step-flow__state"><i class="iconfont icon-ok"></i></div>
					  <p class="step-flow__title-top">重置登陆密码</p>
					</div>
					<div class="step-flow__line">
					  <div class="step-flow__process"></div>
					</div>
					<div class="step-flow__li">
					  <div class="step-flow__state"><i class="iconfont icon-ok"></i></div>
					  <p class="step-flow__title-top">完成</p>
					</div>
				</div>
			</div>
			<form action="/index/vip/modifypwd_step1" class="user-setting__form" role="form" method="post">
				<div class="form-group">
					<input class="form-control" name="pwd" required="" maxlength="11" autocomplete="off" type="password">
					<span class="tip-text">请输入原密码</span>
					<span class="see-pwd pwd-toggle" title="显示密码"><i class="glyphicon glyphicon-eye-open"></i></span>
					<span class="error_tip"></span>
				</div>
				<div class="user-form-group tags-box">
					<button type="submit" class="btn ">提交</button>
				</div>
				<script>
					$(document).ready(function(){
						$('.form-control').on('blur focus',function() {
							$(this).addClass('focus');
							$('.error_tip').empty();
							if ($(this).val() == ''){$(this).removeClass('focus')}
						});
					});
				</script>
			</form>
		</div>
		@elseif($_GET['step']==2)
		<div class="user-content__box clearfix bgf">
			<div class="title">账户信息-修改登陆密码</div>
			<div class="step-flow-box">
				<div class="step-flow__bd">
					<div class="step-flow__li step-flow__li_done">
					  <div class="step-flow__state"><i class="iconfont icon-ok"></i></div>
					  <p class="step-flow__title-top">输入旧密码</p>
					</div>
					<div class="step-flow__line step-flow__li_done">
					  <div class="step-flow__process"></div>
					</div>
					<div class="step-flow__li step-flow__li_done">
					  <div class="step-flow__state"><i class="iconfont icon-ok"></i></div>
					  <p class="step-flow__title-top">重置登陆密码</p>
					</div>
					<div class="step-flow__line step-flow__line_ing">
					  <div class="step-flow__process"></div>
					</div>
					<div class="step-flow__li">
					  <div class="step-flow__state"><i class="iconfont icon-ok"></i></div>
					  <p class="step-flow__title-top">完成</p>
					</div>
				</div>
			</div>
			<form action="/index/vip/modifypwd_step2" id="step2" class="user-setting__form" role="form" method="post">
				<div class="form-group">
					<input class="form-control" name="pwd" required="" maxlength="11" autocomplete="off" type="password">
					<span class="tip-text">新的密码</span>
					<span class="see-pwd pwd-toggle" title="显示密码"><i class="glyphicon glyphicon-eye-open"></i></span>
					<span class="error_tip"></span>
				</div>
				<div class="form-group">
				<div class="form-group">
					<input class="form-control" name="rpwd" required="" maxlength="11" autocomplete="off" type="password">
					<span class="tip-text">再次确认新的密码</span>
					<span class="see-pwd pwd-toggle" title="显示密码"><i class="glyphicon glyphicon-eye-open"></i></span>
					<span class="error_tip"></span>
				</div>
				</div>
				<div class="user-form-group tags-box">
					<button type="submit" class="btn ">提交</button>
				</div>
				<script>
					$(document).ready(function(){
						$('.form-control').on('blur focus',function() {
							$(this).addClass('focus')
							if ($(this).val() == ''){$(this).removeClass('focus')}
						});
					});
				</script>
			</form>
		</div>
		@elseif($_GET['step']==3)
		<div class="user-content__box clearfix bgf">
			<div class="title">账户信息-修改登陆密码</div>
			<div class="step-flow-box">
				<div class="step-flow__bd">
					<div class="step-flow__li step-flow__li_done">
					  <div class="step-flow__state"><i class="iconfont icon-ok"></i></div>
					  <p class="step-flow__title-top">输入旧密码</p>
					</div>
					<div class="step-flow__line step-flow__li_done">
					  <div class="step-flow__process"></div>
					</div>
					<div class="step-flow__li step-flow__li_done">
					  <div class="step-flow__state"><i class="iconfont icon-ok"></i></div>
					  <p class="step-flow__title-top">重置登陆密码</p>
					</div>
					<div class="step-flow__line step-flow__li_done">
					  <div class="step-flow__process"></div>
					</div>
					<div class="step-flow__li step-flow__li_done">
					  <div class="step-flow__state"><i class="iconfont icon-ok"></i></div>
					  <p class="step-flow__title-top">完成</p>
					</div>
				</div>
			</div>
			<div class="modify-success__box text-center">
				<div class="icon b-r50"><i class="iconfont icon-checked cf fz24"></i></div>
				<div class="text c6">登陆密码设置成功！</div>
				<a href="/index/vip/login" class="btn"><span id="sec">1</span> 秒后跳转至登陆页面，如果浏览器未跳转请点击这里</a>
			</div>
			<script>
				$(document).ready(function(){
					var time = 3;
					window.setInterval(function(){
						$('#sec').html(time--);
						if (time < 0) {window.location.href = '/index/vip/login'}
					}, 1000);
				});
			</script>
		</div>
		@endif
	</div>
	<script src="/index/js/login.js"></script>
	<script>
		@if(isset($_GET['error']) && $_GET['error']==1)
			layer.msg('原密码错误',{icon:2});
		@endif
		@if(isset($_GET['error']) && $_GET['error']==2)
			layer.msg('新密码和原密码一致，请重新设置新密码',{icon:2});
		@endif
		$('#step2').submit(function(){
			// alert($('input[name="pwd"]').val());
			if($('input[name="pwd"]').val()!=$('input[name="rpwd"]').val()){
				layer.msg('两次输入的密码不一致',{icon:2});
				return false;
			}
		})
	</script>
@endsection